package com.demo.enhance;

import java.lang.reflect.Method;

public class DefaultAopMethodInterceptor implements AopMethodInterceptor{
    private Object ext;
    private Method method;
    public DefaultAopMethodInterceptor(Object ext, Method method) {
        this.ext = ext;
        this.method = method;
    }
    /**
     * 在此处执行的是带有@Around注解的方法
     * @param mi
     * @return
     * @throws Throwable
     */
    @Override
    public Object invoke(MethodInvocation mi) throws Throwable {
        return  method.invoke(ext,mi);
    }

}
